# -*- coding:utf-8 -*-

# @Time    : 2023/8/20 22:52
# @Author  : zengwenjia
# @Email   : zengwenjia@lingxi.ai
# @File    : user_info.py
# @Software: LLM_internal

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
class UserInfo(object):
    user_info_dict = {
        # "今年年龄": "current_age", "期望退休年龄": "expect_retire_age",
        #               "退休后每个月消费": "retire_cost", "性别": "sex",
        #               "当前是否缴纳社保": "have_social_security", "通货膨胀率": "inflation_rate",
        #               "理财收益率": "financial_management", "养老金收入涨幅": "persion_rise_rate",
        #               "预期寿命": "max_age", "职工社保缴纳年龄": "start_security_age",
        #               "职工社保缴纳年限": "start_security_num", "当前月收入": "total_revenue",
        #               "当前存款": "retire_reserve_fund", "人生阶段": "life_phases", "是否已结婚": "is_married",
        #               "剩余房贷总额": "remaining_mortgage_loan_amount", "孩子当前年龄": "children_age",
        #               "孩子个数": "children_num", "孩子抚养费": "children_cost",
        #               "父母年龄": "parents_age", "要赡养老人数": "parents_num", "父母赡养费": "parents_cost",
        #               "当前月支出": "total_expenditure", "收入年度涨幅": "income_growth_rate",
        #               "社保缴费基数": "monthly_payment_base", "每月社保扣费": "monthly_payment",
        #               "参保城市": "city", "个人养老金余额": "pension_balance", "基础养老金": "basic_pension",
        #               "参保城镇平均工资涨幅": "avg_wage_growth_rate", "退休前一年参保城镇平均工资": "ave_wage_last_year",
        #               "预估法定退休年龄": "legal_retirement_age", "社保缴纳总年限": "total_years_pension_payment",
        #               "个人养老金计算结果": "personal_pension_result", "基础养老金计算结果": "basic_pension_result",
        #               "养老金计算结果": "pension_result"
                      }

    user_info_rule = """
                "城市":"",姓氏":"","年龄":"XX(岁)", "性别":"男/女","为何人考虑":"父母/自己", "所需房型":"一室一厅/一居室/两居室/均超预算","用户是否同意参观":"是/否","对年金险是否有压力":"有压力/无压力"
                """
    def __init__(self):
        pass

    # 根据中文名字获取英文名字
    @classmethod
    def get_english_name(cls, chinese_name):
        return cls.user_info_dict.get(chinese_name, None)

    # 将中文名的dict转换成英文名的dict
    @classmethod
    def get_english_dict(cls, chinese_dict):
        english_dict = {}
        for key, value in chinese_dict.items():
            name_key = cls.get_english_name(key)
            if name_key:
                english_dict[name_key] = value
        return english_dict

    # 根据英文名字获取中文名字
    @classmethod
    def get_chinese_name(cls, english_name):
        for key, value in cls.user_info_dict.items():
            if value == english_name:
                return key
        return None

    # 将英文名的dict转换成中文名的dict
    @classmethod
    def get_chinese_dict(cls, english_dict):
        chinese_dict = {}
        for key, value in english_dict.items():
            name_key = cls.get_chinese_name(key)
            if name_key:
                chinese_dict[name_key] = value
        return chinese_dict

